#define _CRT_SECURE_NO_WARNINGS
#include "List.h"


void Test1()
{
	ListNode* plist = ListCreate();

	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);

	ListPrint(plist);


	ListPopBack(plist);
	ListPrint(plist);

	ListPopBack(plist);

	ListPrint(plist);

	ListDestory(plist);
	plist = NULL;
}

void Test2()
{
	ListNode* plist = ListCreate();
	ListPushFront(plist, 1);
	ListPushFront(plist, 2);
	ListPushFront(plist, 3);
	ListPushFront(plist, 4);
	ListPushFront(plist, 5);
	
	ListPrint(plist);

	ListPopFront(plist);
	ListPrint(plist);


	ListPopFront(plist);
	ListPrint(plist);
}

void Test3()
{
	ListNode* plist = ListCreate();
	ListPushFront(plist, 1);
	ListPushFront(plist, 2);
	ListPushFront(plist, 3);
	ListPushFront(plist, 4);
	ListPushFront(plist, 5);

	ListPrint(plist);

	ListNode* pos = ListFind(plist, 3);
	ListInsert(pos, 30);
	ListPrint(plist);

	ListErase(pos);
	ListPrint(plist);

}


int main()
{
	Test3();

	return 0;
}